package com.smart.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smart.pojo.LoginUser;
import com.smart.pojo.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.smart.req.UserCondition;
import com.smart.resp.UserResp;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;

import javax.sql.RowSet;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lyj
 * @since 2023-04-19
 */
public interface IUserService extends IService<User>, UserDetailsService {

    //获取当天新增员工人数
    int getCountByToday();

    //根据条件进行用户分页查询
    Page<UserResp> queryPageByCondition(UserCondition userCondition, Page<UserResp> userPage);

    List<User> queryByRoleIdAndKeyword(Long roleId, String keyword);

//    List<User> queryByKeywordExcludeRoleId(Long roleId, String keyword);

    boolean associate(Long roleId, Long[] userIds);

    List<User> queryByKeywordExcludeRole(String keyword);

    UserResp queryById(Serializable id);

    LoginUser queryUserInfoById(Long id);

    List<UserResp> queryAll();

    List<UserResp> queryByDeptId(Long departmentId);

    UserResp getUserInfoById(Long userId);

    boolean saveOrUpdateUser(User user);

    boolean dismissedById(Long id);

    Page<UserResp> queryPageByDeptId(Long departmentId, Page<UserResp> userPage);
}
